<template>
  <el-select v-model="value" placeholder="请选择">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value"
      @change="changeselect"
    >
      <span v-html="item.label" />
    </el-option>
  </el-select>
</template>
<script>
import { Ajax } from '@/api/common'
export default {
  name: 'Selectcust',
  props: {
    url: {
      required: true
    },
    selectvalue: {
      required: true
    }
  },
  data() {
    return {
      options: null,
      value: this.selectvalue
    }
  },
  created() {
    this.selectload(this)
  },

  methods: {
    selectload(thisobj) {
      thisobj.url
      var options = []
      Ajax(
        "GetFatherModuleSelect?fatherId='00000000-0000-0000-0000-000000000000'&=itemId='00000000-0000-0000-0000-000000000000",
        [],
        'get',
        function(response) {
          var body = response.data
          thisobj.options = []
          body.data.forEach(element => {
            thisobj.options.push({ value: element.value, label: element.text })
          })
        }
      )
    },
    changeselect() {
    }
  }
}
</script>
